package com.example.invalidatetest;

import java.util.HashMap;

import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;

public class PathCombinedColour {
	
	private Path p1;
	private Paint pccPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	private HashMap<String,String> tags;
	
	public PathCombinedColour(Path p, int c){
		p1 = p;
		
		pccPaint.setColor(c);
		
	}
	
	public PathCombinedColour(Path p, int c, HashMap<String,String> tags){
		p1 = p;
		
		pccPaint.setColor(c);
		
		this.tags = tags;
		
	}
	
	public Path getPath(){
		return p1;
	}
	
	public Paint getPaint(){
		return pccPaint;
	}
	
	public void setTags(HashMap<String,String> tags){
		this.tags = tags;
		
		
		if(tags.containsKey("rail") || tags.containsKey("railway")){
			pccPaint.setColor(Color.BLACK);
			pccPaint.setPathEffect(new DashPathEffect(new float[]{12,12},0));
			
		}
		
		if(tags.containsKey("highway")){
			
			
			if(tags.get("highway").equals("primary")){
			pccPaint.setColor(ColorConstants.Highway);
			pccPaint.setStrokeWidth(20);
			
			
			}
			
			//pccPaint.setPathEffect(new CornerPathEffect(5));
			
		}
		
		//if(tags.get("natural") != null){
			
			if(tags.containsKey("natural")){	
			pccPaint.setColor(ColorConstants.GrassGreen);
			
			
		}
		
		
	}
	
	public HashMap<String,String> getTags(){
		return tags;
	}
	
	public PathCombinedColour(Path p, Paint inputPaint){
		p1 = p;		
		pccPaint = inputPaint;
		
		
	}
	
	

}
